package com.xpsoft.oa.dao.admin.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.admin.AdminExpensesInfoDao;
import com.xpsoft.oa.model.admin.AdminExpensesInfo;

public class AdminExpensesInfoDaoImpl extends BaseDaoImpl<AdminExpensesInfo> implements AdminExpensesInfoDao{

	public AdminExpensesInfoDaoImpl() {
		super(AdminExpensesInfo.class);
	}

	@Override
	public void deleteAdminExpensesInfos(Long expensesId, List<Long> idList) {
		String hql = "delete from AdminExpensesInfo where id not in (:ids) and adminExpenses.id=:expensesId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("expensesId", expensesId);
		query.executeUpdate();
	}

}